//
//  GKUtils.h
//  Gainko
//
//  Created by jinfeng gu on 12-11-1.
//  Copyright (c) 2012年 RanCheng.gu. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface GKUtils : NSObject

+(NSString*)saveImage:(UIImage *)image withFileName:(NSString *)imageName ofType:(NSString *)extension inDirectory:(NSString *)directoryPath;

+(NSString*)saveImage:(UIImage *)image withFileName:(NSString *)imageName ofType:(NSString *)extension;

+(UIImage *)loadImage:(NSString *)fileName ofType:(NSString *)extension inDirectory:(NSString *)directoryPath;

+(UIImage *) loadImage:(NSString *)fileName ofType:(NSString *)extension;

+(id)readPlist:(NSString *)fileName;

+(id)readRTFDoc:(NSString*)fileName;

+(NSString*)convertDateToString:(NSDate*)date;

+(NSArray*)parseThumbUrl:(NSString*)url;

+(NSString*)intervalFromNow:(NSTimeInterval)interval;

+(NSArray *)parseCityStateZip:(NSString *) searchText;

+(NSString *)stringFromDate:(NSDate *)date withFormat:(NSString*)format;

+(NSDate *)dateFromString:(NSString *)dateString withFormat:(NSString*)format;

+(NSString*)intervalAddtionalFromNow:(NSTimeInterval)interval;

+(CGSize)calcSizeFromSting:(NSString*)str boundingRectWithSize:(CGSize)size andFont:(UIFont*)font;

+(NSString *)getCodeNameByName:(NSString*)name;

+(NSString *)getNameByCodeName:(NSString*)codeName;

+(NSString *)getIconNameByCodeName:(NSString*)codeName;

+(BOOL)compareVisible:(NSString*)userCodeName
           targetName:(NSString*)targetCodeName;

+(NSString *)setShareUrl;

+(NSArray*)allLevelNames;

+(float)calcannualizedYield:(float)yield investMoney:(float)money fromDate:(NSDate*)fromDate endDate:(NSDate*)endDate;

//对同一个title文本设置不同的颜色
+(NSMutableAttributedString *)setTitleTextWithText:(NSString*)text sepcialText:(NSString *)specialText publicColor:(UIColor*)publicColor specialColor:(UIColor*)specialColor;

+(NSString *)getNumberIntWithNum:(NSNumber *)number;
+(NSString *)getNumberFloatWithNum:(NSNumber *)number;
+(NSString *)decodeDateNumber:(NSNumber *)num;
@end
